Blitz (110/640)

From:Sami N��t�nen
Date:3 Sep 99 at 18:08:15
Subject:Re: Signed and Unsign numbers; Please help

On 03-Sep-99, Curt Esser wrote.

> Hi Stephen
>
> On 03-Sep-99, Stephen Lebed wrote:
>> Hi everyone,
>>
>> I need to be able to hold values from 0 to 65535 in a word, but Blitz
>> only allows me a signed value from -32768 to 32767. How can I get this to
>> work.
>>
>> If I type
>>
>> a.w=65535
>> Nprint a
>>
>> The answer that I get is
>>
>> -1
>>
>> Of course what I want it to display is 65535
>>
>>
>> Is there a setting that I'm missing?
>
>
> Try this:
>
> First, make sure Overflow Errors is off in the compiler options (in the
> debugger settings) Don't worry - as long as you are not storing values >
> 65535 in the word, no harm is done.
>
> a.w=65535
> b.w=47
>
> Nprint "A = ", a AND $FFFF
> Nprint "B = ", b AND $FFFF
>
> The AND $FFFF makes sure it always returns the unsigned value of the
> variable.
>
> Note that you must do this every time you want to READ the value.
> Don't use it when writing the value.

Well not exactly! Only if you want to display it or you are wanting to put
the value in different type variable well QUICK, LONG AND FLOAT



Sami N��t�nen
EMail: sami.naatanen@dlc.fi

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie